using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using NewsSpider.Model;
using NewsSpider.DAL;

namespace NewsSpider.BLL
{

    /// <summary>
    /// 版权所有: 版权所有(C) 2012，上海云里网络科技有限公司
    /// 内容摘要: CatchWebsitesBLL
    /// 完成日期：2012年1月31日
    /// 版    本：V1.0 
    /// 作    者：Adin
    /// </summary>
    public class CatchWebsitesSQLiteBLL
    {
        CatchWebsitesSQLiteDAL csDAL = new CatchWebsitesSQLiteDAL();

        /// <summary>
        /// 获取CatchWebsites表中所有数据
        /// <returns>返回List类型</returns>
        /// </summary>
        public List<CatchWebsites> GetAllCatchWebsitesBLL()
        {
            return csDAL.GetAllCatchWebsitesDAL();
        }

        /// <summary>
        /// 根据传入的SQL语句获取CatchWebsites表中数据
        /// </summary>
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回List类型</returns>
        public List<CatchWebsites> GetCatchWebsitesByWhereBLL(string strSql)
        {
            return csDAL.GetCatchWebsitesByWhereDAL(strSql);
        }

        /// <summary>
        /// 往CatchWebsites表中插入数据
        /// </summary>
        /// <returns>返回插入条数</returns>
        public int InsertCatchWebsitesBLL(NewsSpider.Model.CatchWebsites cs)
        {
            return csDAL.InsertCatchWebsitesDAL(cs);
        }

        /// <summary>
        /// 根据ID更新CatchWebsites表中数据
        /// </summary>
        /// <param name="cs">实例化CatchWebsites类</param>
        /// <returns>返回更新条数</returns>
        public int UpdateCatchWebsitesBLL(NewsSpider.Model.CatchWebsites cs)
        {
            return csDAL.UpdateCatchWebsitesDAL(cs);
        }

        /// <summary>
        /// 根据指定条件删除CatchWebsites表中数据
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回删除条数</returns>
        public int DeleteCatchWebsitesBLL(string strSql)
        {
            return csDAL.DeleteCatchWebsitesDAL(strSql);
        }

        /// <summary>
        /// 绑定表CatchWebsites到DataGridView
        /// <param name="dgv">DataGridView控件名称</param>
        /// <param name="strSql">SQL语句</param>
        /// </summary>
        public void BindCatchWebsitesBLL(System.Windows.Forms.DataGridView dgv, string strSql)
        {
            csDAL.BindCatchWebsitesDAL(dgv, strSql);
        }
    }
}
